<?php

require_once ('../commons_constantes.php');

/**
 * Page de suppression des cookies de l'appllication
 */

$cookies2Kill = array
				(COOKIE_AUTH_NAME
				,COOKIE_APP_NAME
				);

$oneCookieSuppressed = false;
foreach ($cookies2Kill as $cookieName) {
	$cookie2Suppress = $cookieName.'_'.$_SERVER['SERVER_NAME'];
	if (isset($_COOKIE[$cookie2Suppress])) {
		setcookie($cookie2Suppress, null, 0);
		$oneCookieSuppressed = true;
		echo "Cookie $cookieName supprimé.<br />";
	}
}

if (!$oneCookieSuppressed) {
	echo 'Aucun cookie n\'a été supprimé.<br />';
}